<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
    <meta name="format-detection" content="telephone=no, email=no"/>
    <meta name="apple-mobile-web-app-capable" content="yes"/>
    <meta name="apple-mobile-web-app-status-bar-style" content="black"/>
</head>
<body>

<script>

    /*
    * 构造函数命名：首字母大写（规范）
    * 构造函数执行,需要使用new关键字来执行
    * */
    function Person(name,age,Boyfriend) {
        this.name = name
        this.age = age
        this.Boyfriend= function () {
            document.write('纸上得来终觉浅，绝知此事要躬行。')
        }
//        console.log(123);
    }
    var obj = new Person("小明","20岁");//使用new关键字去执行函数
    document.write(obj.name+'今年'+obj.age+'ta男朋友说：')
    obj.Boyfriend()

</script>

</body>
</html>